import requests


class weblogin:
    def __init__(self):
        self.url="http://192.168.1.1/cgi-bin/luci"

    def login(self,data):
        header={
            "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
            "Accept-Encoding":"gzip, deflate",
            "Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
            "Cache-Control":"max-age=0",
            "Connection":"keep-alive",
            "Content-Length":"35",
            "Content-Type":"application/x-www-form-urlencoded",
            "Dnt":"1",
            "Host":"192.168.1.1",
            "Origin":"http://192.168.1.1",
            "Referer":"http://192.168.1.1/cgi-bin/luci",
            "Upgrade-Insecure-Requests":"1",
            "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
            }
        return requests.post(url=self.url,data=data,headers=header)